load("@rules_cc//cc:cc_library.bzl", "cc_library")

cc_library(
    name = "hiredis",
    srcs = [
        "alloc.c",
        "async.c",
        "async_private.h",
        "dict.h",
        "fmacros.h",
        "hiredis.c",
        "net.c",
        "net.h",
        "read.c",
        "sds.c",
        "sdsalloc.h",
        "sockcompat.c",
        "win32.h",
    ],
    hdrs = [
        "alloc.h",
        "async.h",
        "hiredis.h",
        "read.h",
        "sds.h",
        "sockcompat.h",
    ],
    include_prefix = "hiredis",
    local_defines = [
        "_CRT_SECURE_NO_WARNINGS",
        "WIN32_LEAN_AND_MEAN",
    ],
    textual_hdrs = [
        "dict.c",
    ],
    visibility = ["//visibility:public"],
)

cc_library(
    name = "hiredis_ssl",
    srcs = [
        "async_private.h",
        "ssl.c",
        "win32.h",
    ],
    hdrs = ["hiredis_ssl.h"],
    include_prefix = "hiredis",
    local_defines = [
        "_CRT_SECURE_NO_WARNINGS",
        "WIN32_LEAN_AND_MEAN",
    ],
    deps = [
        ":hiredis",
        "@boringssl//:ssl",
    ],
)

alias(
    name = "ssl",
    actual = "hiredis_ssl",
    visibility = ["//visibility:public"],
)
